﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace Domain
{
  public class EFDbContext : DbContext
  {
    public DbSet<Region> Regions { get; set; }

    public EFDbContext() : base("PocExcelImport3") { }

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
      modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
      modelBuilder.Entity<Region>().HasOptional(r => r.Parent);
    }

  }
}
